# Contributor: Lucas Ramage <ramage.lucas@protonmail.com>
# Maintainer: Lucas Ramage <ramage.lucas@protonmail.com>
pkgname=libsds
_pkgname=sds
pkgver=2.0.0
_pkgmajver=2
pkgrel=1
pkgdesc="Simple Dynamic Strings library for C"
arch="all"
url="https://github.com/antirez/sds"
license="BSD-2-Clause"
source="$pkgname-$pkgver.tar.gz::https://github.com/antirez/$_pkgname/archive/$pkgver.tar.gz
	01-gcc-pedantic.patch
	02-install-target.patch"
subpackages="$pkgname-dev"
builddir="$srcdir/$_pkgname-$pkgver"

check() {
	make sds-test
}

package() {
	PREFIX=/usr DESTDIR="$pkgdir" make -e sds-install

	# Manually create symlinks
	ln -s $pkgname.so.$pkgver "$pkgdir"/usr/lib/$pkgname.so.$_pkgmajver
	ln -s $pkgname.so.$_pkgmajver "$pkgdir"/usr/lib/$pkgname.so
}

sha512sums="82c40ffcb722cda57fe08ca4d465e5144270cec9c5ba18d2a5da88b89e7d402f781f86675db53bd1c7a752641888ee50cbf6b21f0582f428d3aa9e6fe0357ad7  libsds-2.0.0.tar.gz
0fd8adf7d7d1863d2dcaf46749b422e33d2a189ee9a68a628f3717724462382651b0da2d0fa77c6e886e1bb2c047a89d45fb998228948e100440b8a64f28b2e9  01-gcc-pedantic.patch
cf15fa20d370fa86764941406c22b9bf54d163e2ff1c9f55e66a8b0c475a8d91e3f18ca2f427ccbb1fe35779ced65313aaa52aa456d82d21c06cb6187f5429d2  02-install-target.patch"
